package com.wang.service.impl;


import com.wang.entity.Student;
import com.wang.service.StudentService;
import org.springframework.stereotype.Service;

import java.net.InetAddress;

/**
 * @author wangyandong
 * @date 2020/1/26 12:17
 */
@Service
public class StudentServiceImpl implements StudentService {
    @Override
    public Student getById(Integer id){
        try {
            String hostAddress = InetAddress.getLocalHost().getHostAddress();
            return new Student(id==null?12:id,hostAddress,25);
        }catch (Exception e){

        }
        return new Student(id==null?12:id,"wang",25);
    }
}
